<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <p v-for="i in 3" :key="i">
            {{ name }}-{{genderStr}}-{{dataTime}}
        </p>
    </div>
    <!-- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> -->
    <script src="../assets/vue3.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return {
                    name: '张三',
                    gender: 1,
                    time: 1670944665
                }
            },
            computed: {
                genderStr() {
                    console.log('gender')
                    return this.gender == 1 ? '男' : '女';
                },
                dataTime() {
                    console.log('dataTime')
                    const date = new Date(this.time)
                    return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
                }
            },
        });
        app.mount('#app');
    </script>
</body>

</html>